Dynomotion

Group: DynoMotion Message: 5178 From: himykabibble Date: 6/10/2012
Subject: KFlop Serial Port
Tom,

I'm making a new pendant, and wanted to make sure there are no issues with the way I intend to do it. I've bought a commercial USB pendant, that has an on-board PIC processor. I'm going to disable the USB, and instead wire up the on-chip RS232 port. The MPG and E-Stop will be wired directly to the KFlop, and the state of all the switches and buttons will be sent over RS232, as periodic messages, each consisting of 4 characters. I'm thinking I'll probably send messages at a 10 mSec period, sending them only when something changes. I'll then have a KFlop program that receives these messages, and performs the appropriate action. Do you see any problems with this approach?

Regards,
Ray L.
Group: DynoMotion Message: 5179 From: Tom Kerekes Date: 6/10/2012
Subject: Re: KFlop Serial Port
Hi Ray,
 
Seems reasonable to me.  I assume you have access to the pendent PIC code to be able to make those changes.
 
You might need a means of synchronizing the 4 characters.
 
Would the message include the MPG encoder position somehow?
 
Regards
TK 

From: himykabibble <jagboy@...>
To: DynoMotion@yahoogroups.com
Sent: Sunday, June 10, 2012 9:10 PM
Subject: [DynoMotion] KFlop Serial Port

 
Tom,

I'm making a new pendant, and wanted to make sure there are no issues with the way I intend to do it. I've bought a commercial USB pendant, that has an on-board PIC processor. I'm going to disable the USB, and instead wire up the on-chip RS232 port. The MPG and E-Stop will be wired directly to the KFlop, and the state of all the switches and buttons will be sent over RS232, as periodic messages, each consisting of 4 characters. I'm thinking I'll probably send messages at a 10 mSec period, sending them only when something changes. I'll then have a KFlop program that receives these messages, and performs the appropriate action. Do you see any problems with this approach?

Regards,
Ray L.



Group: DynoMotion Message: 5180 From: himykabibble Date: 6/10/2012
Subject: Re: KFlop Serial Port
Tom,

No, I'm writing the code from scratch. It's really trivial. As I said, the MPG A/B lines will hard-wired directly to KFlop, the PIC only needs to handle the switches - scanning, debouncing, and detecting holds and double-clicks, which it reports to the KFlop. Each message will contain the de-bounced states of all the switch inputs.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Seems reasonable to me.  I assume you have access to the pendent PIC code to be able to make those changes.
>  
> You might need a means of synchronizing the 4 characters.
>  
> Would the message include the MPG encoder position somehow?
>  
> Regards
> TK 
>
>
> ________________________________
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, June 10, 2012 9:10 PM
> Subject: [DynoMotion] KFlop Serial Port
>
>
>  
>
> Tom,
>
> I'm making a new pendant, and wanted to make sure there are no issues with the way I intend to do it. I've bought a commercial USB pendant, that has an on-board PIC processor. I'm going to disable the USB, and instead wire up the on-chip RS232 port. The MPG and E-Stop will be wired directly to the KFlop, and the state of all the switches and buttons will be sent over RS232, as periodic messages, each consisting of 4 characters. I'm thinking I'll probably send messages at a 10 mSec period, sending them only when something changes. I'll then have a KFlop program that receives these messages, and performs the appropriate action. Do you see any problems with this approach?
>
> Regards,
> Ray L.
>
Group: DynoMotion Message: 5181 From: himykabibble Date: 6/11/2012
Subject: Re: KFlop Serial Port
Tom,

Am I losing my mind? I thought there was an RS232 I/F on the KFlop, but now I can't find it....

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> No, I'm writing the code from scratch. It's really trivial. As I said, the MPG A/B lines will hard-wired directly to KFlop, the PIC only needs to handle the switches - scanning, debouncing, and detecting holds and double-clicks, which it reports to the KFlop. Each message will contain the de-bounced states of all the switch inputs.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> >  
> > Seems reasonable to me.  I assume you have access to the pendent PIC code to be able to make those changes.
> >  
> > You might need a means of synchronizing the 4 characters.
> >  
> > Would the message include the MPG encoder position somehow?
> >  
> > Regards
> > TK 
> >
> >
> > ________________________________
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Sunday, June 10, 2012 9:10 PM
> > Subject: [DynoMotion] KFlop Serial Port
> >
> >
> >  
> >
> > Tom,
> >
> > I'm making a new pendant, and wanted to make sure there are no issues with the way I intend to do it. I've bought a commercial USB pendant, that has an on-board PIC processor. I'm going to disable the USB, and instead wire up the on-chip RS232 port. The MPG and E-Stop will be wired directly to the KFlop, and the state of all the switches and buttons will be sent over RS232, as periodic messages, each consisting of 4 characters. I'm thinking I'll probably send messages at a 10 mSec period, sending them only when something changes. I'll then have a KFlop program that receives these messages, and performs the appropriate action. Do you see any problems with this approach?
> >
> > Regards,
> > Ray L.
> >
>
Group: DynoMotion Message: 5182 From: himykabibble Date: 6/11/2012
Subject: Re: KFlop Serial Port
OK, I found the information on the pinout, but I'm confused by some of the example code:

1) What does setting DoRS232Cmds TRUE do?
2) What is void EnableRS232Cmds(int baud) used for? Is it just a combination of InitRS232(baudrate) and DoRS232Cmds = TRUE?

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> Am I losing my mind? I thought there was an RS232 I/F on the KFlop, but now I can't find it....
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > No, I'm writing the code from scratch. It's really trivial. As I said, the MPG A/B lines will hard-wired directly to KFlop, the PIC only needs to handle the switches - scanning, debouncing, and detecting holds and double-clicks, which it reports to the KFlop. Each message will contain the de-bounced states of all the switch inputs.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > >  
> > > Seems reasonable to me.  I assume you have access to the pendent PIC code to be able to make those changes.
> > >  
> > > You might need a means of synchronizing the 4 characters.
> > >  
> > > Would the message include the MPG encoder position somehow?
> > >  
> > > Regards
> > > TK 
> > >
> > >
> > > ________________________________
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Sunday, June 10, 2012 9:10 PM
> > > Subject: [DynoMotion] KFlop Serial Port
> > >
> > >
> > >  
> > >
> > > Tom,
> > >
> > > I'm making a new pendant, and wanted to make sure there are no issues with the way I intend to do it. I've bought a commercial USB pendant, that has an on-board PIC processor. I'm going to disable the USB, and instead wire up the on-chip RS232 port. The MPG and E-Stop will be wired directly to the KFlop, and the state of all the switches and buttons will be sent over RS232, as periodic messages, each consisting of 4 characters. I'm thinking I'll probably send messages at a 10 mSec period, sending them only when something changes. I'll then have a KFlop program that receives these messages, and performs the appropriate action. Do you see any problems with this approach?
> > >
> > > Regards,
> > > Ray L.
> > >
> >
>
Group: DynoMotion Message: 5185 From: Tom Kerekes Date: 6/11/2012
Subject: Re: KFlop Serial Port
Hi Ray,
 
The function call EnableRS232Cmds(BAUD) does all the necessary configuration of the UART and FIFO buffering routines and sets DoRS232Cmds=TRUE to allow serial incoming Console Script Commands to be automatically processed by KFLOP (USB IO is no longer serviced).  To do the Configuration but not switch to accepting Commands from RS232 reset the flag after the call.
 
Regards
TK

Group: DynoMotion Message: 13477 From: gyelle10 Date: 7/6/2016
Subject: Re: KFlop Serial Port
Hi Tom,

I'm not sure how to use the serial communication with UART. I've browsed the forum and I didn't find any answer.

Does this program allows serial incoming Console Script Commands to be automatically processed by KFLOP ?

#include "KMotionDef.h"

main()
{
EnableRS232Cmds(RS232_BAUD_38400);
DoRS232Cmds = TRUE;  
}

I tried it and when I sent : Execute4 , it returned me Execute4, but did not execute my thread 4... (It executed when I called Execute4 in the console previously).

 
GY

Group: DynoMotion Message: 13479 From: Tom Kerekes Date: 7/6/2016
Subject: Re: KFlop Serial Port

Hi GY,

Did terminate with CR + LF?

Maybe try a simpler command like ClearBit46 to see if the KFLOP LED goes off.

Regards
TK

On 7/6/2016 12:00 PM, gyelle10@... [DynoMotion] wrote:
 

Hi Tom,


I'm not sure how to use the serial communication with UART. I've browsed the forum and I didn't find any answer.

Does this program allows serial incoming Console Script Commands to be automatically processed by KFLOP ?

#include "KMotionDef.h"

main()
{
EnableRS232Cmds(RS232_BAUD_38400);
DoRS232Cmds = TRUE;  
}

I tried it and when I sent : Execute4 , it returned me Execute4, but did not execute my thread 4... (It executed when I called Execute4 in the console previously).

 
GY


Group: DynoMotion Message: 13482 From: gyelle10 Date: 7/6/2016
Subject: Re: KFlop Serial Port
Hi Tom,

It does the same thing with ClearBit46, (the led didnt go off) and it returned me the command (ClearBit46). I don't know if it terminate with CRLF, I'm using Hercules to communicate with Kflop UART and my settings are the following :

Baud 38400
Data size : 8
Parity : none
Handshake : OFF 
Mode : free

GY
 



On Wednesday, July 6, 2016 3:04 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:


 
Hi GY,
Did terminate with CR + LF?
Maybe try a simpler command like ClearBit46 to see if the KFLOP LED goes off.
Regards
TK

On 7/6/2016 12:00 PM, gyelle10@... [DynoMotion] wrote:
 
Hi Tom,

I'm not sure how to use the serial communication with UART. I've browsed the forum and I didn't find any answer.

Does this program allows serial incoming Console Script Commands to be automatically processed by KFLOP ?

#include "KMotionDef.h"

main()
{
EnableRS232Cmds(RS232_BAUD_38400);
DoRS232Cmds = TRUE;  
}

I tried it and when I sent : Execute4 , it returned me Execute4, but did not execute my thread 4... (It executed when I called Execute4 in the console previously).

 
GY




Group: DynoMotion Message: 13483 From: Tom Kerekes Date: 7/6/2016
Subject: Re: KFlop Serial Port

Hi GY,

Try typing CTRL-M CTRL-J (for CR LF).

Regards

TK


On 7/6/2016 12:27 PM, gyelle10@... [DynoMotion] wrote:
 
Hi Tom,

It does the same thing with ClearBit46, (the led didnt go off) and it returned me the command (ClearBit46). I don't know if it terminate with CRLF, I'm using Hercules to communicate with Kflop UART and my settings are the following :

Baud 38400
Data size : 8
Parity : none
Handshake : OFF 
Mode : free

GY
 



On Wednesday, July 6, 2016 3:04 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:


 
Hi GY,
Did terminate with CR + LF?
Maybe try a simpler command like ClearBit46 to see if the KFLOP LED goes off.
Regards
TK

On 7/6/2016 12:00 PM, gyelle10@... [DynoMotion] wrote:
 
Hi Tom,

I'm not sure how to use the serial communication with UART. I've browsed the forum and I didn't find any answer.

Does this program allows serial incoming Console Script Commands to be automatically processed by KFLOP ?

#include "KMotionDef.h"

main()
{
EnableRS232Cmds(RS232_BAUD_38400);
DoRS232Cmds = TRUE;  
}

I tried it and when I sent : Execute4 , it returned me Execute4, but did not execute my thread 4... (It executed when I called Execute4 in the console previously).

 
GY





Group: DynoMotion Message: 13490 From: gyelle10 Date: 7/7/2016
Subject: Re: KFlop Serial Port
Thanks Tom, it is what I needed ! 
I also can send : COMMAND followed by :  <CR>.

GY
 

 


Sent from Yahoo Mail. Get the app


On Wednesday, July 6, 2016 4:37 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:


 
Hi GY,
Try typing CTRL-M CTRL-J (for CR LF).
Regards
TK

On 7/6/2016 12:27 PM, gyelle10@... [DynoMotion] wrote:
 
Hi Tom,

It does the same thing with ClearBit46, (the led didnt go off) and it returned me the command (ClearBit46). I don't know if it terminate with CRLF, I'm using Hercules to communicate with Kflop UART and my settings are the following :

Baud 38400
Data size : 8
Parity : none
Handshake : OFF 
Mode : free

GY
 



On Wednesday, July 6, 2016 3:04 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:


 
Hi GY,
Did terminate with CR + LF?
Maybe try a simpler command like ClearBit46 to see if the KFLOP LED goes off.
Regards
TK

On 7/6/2016 12:00 PM, gyelle10@... [DynoMotion] wrote:
 
Hi Tom,

I'm not sure how to use the serial communication with UART. I've browsed the forum and I didn't find any answer.

Does this program allows serial incoming Console Script Commands to be automatically processed by KFLOP ?

#include "KMotionDef.h"

main()
{
EnableRS232Cmds(RS232_BAUD_38400);
DoRS232Cmds = TRUE;  
}

I tried it and when I sent : Execute4 , it returned me Execute4, but did not execute my thread 4... (It executed when I called Execute4 in the console previously).

 
GY